package model;

import interfaces.KurvItemInterface;
import interfaces.VareInterface;
import java.rmi.RemoteException;
import java.rmi.server.UnicastRemoteObject;

public class KurvItem extends UnicastRemoteObject implements KurvItemInterface { 

    private final int ordreID;
    private final VareInterface vare;
    private final double pris;
    private final int antal;

    public KurvItem(int ordreID, VareInterface vare, int antal) throws RemoteException {
        this.ordreID = ordreID;
        this.vare = vare;
        this.antal = antal;
        pris = antal * vare.getVarePris();        
    }

    @Override
    public int getOrdreID() throws RemoteException {
        return ordreID;
    }

    @Override
    public VareInterface getVare() throws RemoteException {
        return vare;
    }

    @Override
    public double getPris() throws RemoteException {
        return pris;
    }

    @Override
    public int getAntal() throws RemoteException {
        return antal;
    }
    
    
    
    

}
